package org.hong.monkey.repl

import scala.tools.nsc.{Settings, CompilerCommand}
import scala.Predef._
import org.hong.monkey.annotation.DeveloperApi

/**
 * Command class enabling Monkey-specific command line options (provided by
 * <i>org.hong.monkey.repl.MonkeyRunnerSettings</i>).
 *
 * @example new MonkeyCommandLine(Nil).settings
 *
 * @param args The list of command line arguments
 * @param settings The underlying settings to associate with this set of
 *                 command-line options
 */
@DeveloperApi
class MonkeyCommandLine(args: List[String], override val settings: Settings)
    extends CompilerCommand(args, settings) {
  def this(args: List[String], error: String => Unit) {
    this(args, new MonkeyRunnerSettings(error))
  }

  def this(args: List[String]) {
    // scalastyle:off println
    this(args, str => Console.println("Error: " + str))
    // scalastyle:on println
  }
}
